//
//  ViewController.swift
//  AFNTest
//
//  Created by Admin on 2016/11/1.
//  Copyright © 2016年 Admin. All rights reserved.
//

import UIKit

var xxx = person()
var yyy = httpTool()
var acc = Account()
var accT = AccountTool()



class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        xxx.account = "aabbcc"
        xxx.password = "123456"
//        xxx.name = "apple"
//        xxx.password = "123456"
//        xxx.account = "aabbcc"
//        xxx.birthday = "1991-04-28"
//        xxx.sex = 1
//        xxx.height = 180
//        xxx.activity = 2
//        xxx.userKind = 1
//        yyy.creatUser(person: xxx, sucess:{  (AnyObject) in
//            
//        }, failure: {(Error) in
//            
//        })
        // Do any additional setup after loading the view.
        
//        print(person.acc(dict: ["111":"111"]))
        yyy.Login(person: xxx, sucess: {(AnyObject) in
            let dictN = ["token":AnyObject?["token"],"tokenExpiration":AnyObject?["tokenExpiration"]]
            acc = Account.token(withDict: dictN)
            AccountTool.saveAccount(acc)
            print(acc.token,acc.tokenExpiration)
        }, failure: {(NSError) in
        })
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
